package com.lin.service.impl;

import com.lin.entity.MusicData;
import com.lin.mapper.MusicDataMapper;
import com.lin.service.MusicDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

@Service
public class MusicDataServiceImpl implements MusicDataService {


    @Autowired
    private MusicDataMapper musicDataMapper;

    /**
     * 点赞收藏转发
     * @param musicData
     */
    public void setMusic(MusicData musicData) {
        musicData.setTime(LocalDateTime.now());
        musicDataMapper.setMusic(musicData);
    }

    /**
     * 取消点赞收藏
     * @param musicData
     */
    public boolean delete(MusicData musicData) {
        return musicDataMapper.delete(musicData);
    }
}
